package com.hotel.controller;

import com.hotel.entity.RoomType;
import com.hotel.service.RoomTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;



/**
 * @author 夏智力
 * @FileName RoomTypeController
 * @date 2021/6/22 14:50
 * @Software: IntelliJ IDEA
 */
@RestController
@Slf4j
public class RoomTypeController {

    @Autowired
    private RoomTypeService roomTypeService;

    // 添加房间类型
    @RequestMapping(path = "/type/add", method = RequestMethod.POST)
    public void addRoomType(RoomType roomType) {
        roomTypeService.addRoomType(roomType);
    }

    // 修改房间类型相关信息
    @RequestMapping(path = "/type/update", method = RequestMethod.POST)
    public void updateRoomType(RoomType roomType) {
        roomTypeService.updateRoomType(roomType);
    }

    // 删除房间类型
    @RequestMapping(path = "/type/delete", method = RequestMethod.DELETE)
    public void deleteRoomType(int id) {
        roomTypeService.deleteRoomType(id);
    }

}
